﻿Public Class MainMenu
    Public checkInButton As Button
    Public checkOutButton As Button
    Public bookedOnlineButton As Button
    Public extendButton As Button
    Public panel As Panel



    Public Sub ShowMainMenu()
        panel = New Windows.Forms.Panel
        panel.Name = "mainPanel"
        panel.Size = New System.Drawing.Size(800, 500)
        panel.Location = New System.Drawing.Point(0, 0)
        panel.BackgroundImage = Image.FromFile _
            (System.Environment.GetFolderPath _
            (System.Environment.SpecialFolder.Personal) _
            & "\bckgrnd.png")

        checkInButton = New Windows.Forms.Button
        checkInButton.Name = "checkInButton"
        checkInButton.Location = New System.Drawing.Point(100, 100)
        checkInButton.Size = New System.Drawing.Size(125, 125)
        checkInButton.Text = "Check-In"
        checkInButton.BackColor = Color.White

        checkOutButton = New Windows.Forms.Button
        checkOutButton.Name = "checkOutButton"
        checkOutButton.Location = New System.Drawing.Point(250, 100)
        checkOutButton.Size = New System.Drawing.Size(125, 125)
        checkOutButton.Text = "Check-Out"
        checkOutButton.BackColor = Color.White

        bookedOnlineButton = New Windows.Forms.Button
        bookedOnlineButton.Name = "bookedOnlineButton"
        bookedOnlineButton.Location = New System.Drawing.Point(100, 250)
        bookedOnlineButton.Size = New System.Drawing.Size(125, 125)
        bookedOnlineButton.Text = "Booked Online"
        bookedOnlineButton.BackColor = Color.White

        extendButton = New Windows.Forms.Button
        extendButton.Name = "extendButton"
        extendButton.Location = New System.Drawing.Point(250, 250)
        extendButton.Size = New System.Drawing.Size(125, 125)
        extendButton.Text = "Extend"
        extendButton.BackColor = Color.White

        AddHandler checkInButton.Click, AddressOf checkInButton_Click
        AddHandler checkOutButton.Click, AddressOf checkOutButton_Click
        AddHandler bookedOnlineButton.Click, AddressOf bookedOnlineButton_Click
        AddHandler extendButton.Click, AddressOf extendButton_Click

        panel.Controls.Add(checkInButton)
        panel.Controls.Add(checkOutButton)
        panel.Controls.Add(bookedOnlineButton)
        panel.Controls.Add(extendButton)
        Form1.Controls.Add(panel)
    End Sub

    Private Sub checkInButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Dim cip As New CheckInPage()
        cip.CheckInClicked()
        cip.panel.BringToFront()

    End Sub

    Private Sub checkOutButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        checkInButton.Visible = False
        checkOutButton.Visible = False
        bookedOnlineButton.Visible = False
        extendButton.Visible = False

    End Sub
    Private Sub bookedOnlineButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim boc As New BookedOnlinePage()
        boc.BookedOnlineClicked()
        boc.panel.BringToFront()

    End Sub
    Private Sub extendButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        checkInButton.Visible = False
        checkOutButton.Visible = False
        bookedOnlineButton.Visible = False
        extendButton.Visible = False

    End Sub
    
End Class
